<div class="pageheader">
	<h1 class="pagetitle">Endereços</h1>
	<span class="pagedesc"></span>
	<?php if($this->AclLink->check('Enderecos.add')){ ?>
		<div class="btn_top_and_right"><?php echo $this->Html->link('Novo Endereço', array('action' => 'add'), array('class' => 'stdbtn btn_blue')); ?></div>
	<?php } ?>
</div>

<div id="contentwrapper" class="contentwrapper">
	<table cellpadding="0" cellspacing="0" border="0" class="stdtable dyntable">
		<thead>
			<tr>
				<th class="numeric">Perfil Id</th>
				<th>Logradouro</th>
				<th class="date">Criado</th>
				<th class="date">Modificado</th>
				<th>Ações</th>
			</tr>
		</thead>
		<tbody>
			<?php foreach ($enderecos as $endereco): ?>
				<tr>
					<td>
						<?php echo $this->Html->link($endereco['Endereco']['id'], array('action' => 'view', $endereco['Endereco']['id'])); ?>
					</td>
					<td>
						<?php echo $this->Html->link($endereco['Endereco']['logradouro'], array('action' => 'view', $endereco['Endereco']['id'])); ?>
					</td>
					<td>
						<?php echo $this->Html->link($this->Time->format('d/m/Y H:i:s', $endereco['Endereco']['created']), array('action' => 'view', $endereco['Endereco']['id'])); ?>
					</td>
					<td>
						<?php echo $this->Html->link($this->Time->format('d/m/Y H:i:s', $endereco['Endereco']['modified']), array('action' => 'view', $endereco['Endereco']['id'])); ?>
					</td>
					<td>
						<?php if($this->AclLink->check('Enderecos.edit')){ ?>
							<?php echo $this->Html->link($this->Html->image('edit.png'), array('action' => 'edit', $endereco['Endereco']['id']), array('escape' => false, 'title' => 'Editar')); ?>
						<?php } ?>

						<?php if($this->AclLink->check('Enderecos.delete')){ ?>
							<?php echo $this->Form->postLink(
								$this->Html->image('delete.png'),
								array('action' => 'delete', $endereco['Endereco']['id']),
								array('confirm' => 'Você tem certeza?', 'escape' => false, 'title' => 'Deletar'));
							?>
						<?php } ?>
					</td>
				</tr>
			<?php endforeach; ?>
		</tbody>
	</table>
</div>